package com.pioneer.gui.invoice.view;

import com.pioneer.gui.invoice.model.InvoiceModel;
import com.pioneer.gui.invoice.model.InvoiceTableModel;

import com.pioneer.gui.invoice.controller.InvoiceTableModeltoDetailsPanelAdapter;


import java.awt.Component;
import java.awt.GridLayout;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;

import javax.swing.JPanel;
import javax.swing.JLabel;
import javax.swing.JTable;
import javax.swing.JTextField;
import javax.swing.JScrollPane;
import javax.swing.JComboBox;
import javax.swing.table.DefaultTableCellRenderer;

import javax.swing.event.TableModelListener;
import javax.swing.event.TableModelEvent;

import javax.swing.event.TableModelEvent;


public class DetailsPanel
extends JPanel
{	
	private InvoiceModel model;
	//private TableModelListener _tableModelListenerList;
	public DetailsTable detailsTable;
	
	public DetailsPanel(InvoiceModel model)
	{	
		this.model=model;
		this.setLayout(new GridLayout(1,1));
		detailsTable=new DetailsTable(model);
		
		JScrollPane scrollpane = new JScrollPane(detailsTable);
		this.add(scrollpane);
		detailsTable.getModel().addTableModelListener(new InvoiceTableModeltoDetailsPanelAdapter(model, this));
	
		//this._tableModelListenerList.add (TableModelListener.class, l);
		//l.tableChanged(new TableModelEvent(this));		
	}
	
}